﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FullThrustLogic.ShipComponent
{
    public class Hull
    {
        public Hull()
        {
            Stregth = new Dictionary<int, HullStregth>();
        }

        public Dictionary<int, HullStregth> Stregth
        {
            get;
            set;
        }

        public int SystemCheckLevel
        {
            get
            {
                int _systemCheckLevel = 0;
                foreach(KeyValuePair<int, HullStregth> kvp in Stregth.OrderBy((a) => a.Key))
                {
                 if(kvp.Value.CurrentDamage < kvp.Value.MaxDamage)
                 {
                     _systemCheckLevel = kvp.Key - 1;
                 }
                }

                return _systemCheckLevel;
            }
        }

        public int ThresholdLevel
        {
            get;
            set;
        }

        public int MaxThresholdLevel
        {
            get;
            set;
        }
    }
}
